package com.jinke.api.common.util;

import java.text.DecimalFormat;

public class MathTool {


    public static String formatPercentage(int noinfoNum, int total) {
        double result = (double) noinfoNum / total;
        DecimalFormat df = new DecimalFormat("#.00");
        String formattedResult = df.format(result * 100);
        return formattedResult + "%";
    }

    public static void main(String[] args) {
        String percentage = MathTool.formatPercentage(5, 10);
        System.out.println(percentage);
    }
}
